package com.gopay.common.domain.fund;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "FUND_GOPAY_CPS_GEN_ORDER")
public class FundGopayCpsGenOrder extends BaseEntity {
    private String keyId;
    private String gopayOrderId;
    private String agentSignNo;
    private Integer transDtlSeq;
    private String fundNo;
    private String gopayIntTxnCd;
    private String merchantId;
    private String merOrderNum;
    private String tranType;
    private String orderType;
    private BigDecimal totalOrderAmt;
    private BigDecimal totalOrderFeeAmt;
    private BigDecimal orderDealAmt;
    private BigDecimal orderRealFeeAmt;
    private Date tranFinishTime;
    private String origMerOrderNum;
    private String respCode;
    private String verifyCode;
    private String cardNo;
    private String bankCode;
    private Date stlmDate;
    private String backgroundMerUrl;
    private String merRemark1;
    private String merRemark2;
    private String tranIp;
    private String dataSource;
    private String source;
    private String memo;
    private Date createdTs;
    private Date lastUpdTs;
    private Integer version;

    private Date merTxnTm;//商户交易提交时间

    private Integer countNum;//总笔数

    private String relevanceGopayOrderId;//关联交易国付宝订单号

    private String bizType;//业务类型

    private BigDecimal merTxnAmt;//商户上送金额

    private String historyOrderId;//关联00700历史失败订单，逗号分隔。
    private String lastErrorMsg;//上次失败原因
    private Date lastRedoTs;//最后一次重发时间

    /** 
     * 提现类型：0、T0 ; 1、T1
     */
    private String withdrawType;

    /** 
     * 提现目标账户类型：0、到余额；1、到银行卡
     */
    private String withdrawAcctType;

    /**
     * 提现到余额的账户号
     */
    private String withdrawAcctId;

    @Id
    @GenericGenerator(name="systemUUID",strategy="uuid")
    @GeneratedValue(generator="systemUUID")
    @Column(name = "KEY_ID", insertable = true, updatable = true, nullable = false)
    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Basic
    @Column(name = "MER_TXN_TM",length = 200)
    public Date getMerTxnTm() {
        return merTxnTm;
    }

    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    @Basic
    @Column(name = "GOPAY_ORDER_ID", unique = true, nullable = false, length = 16)
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Basic
    @Column(name = "AGENT_SIGN_NO",length = 50)
    public String getAgentSignNo() {
        return agentSignNo;
    }

    public void setAgentSignNo(String agentSignNo) {
        this.agentSignNo = agentSignNo;
    }

    @Basic
    @Column(name = "TRANS_DTL_SEQ",length = 20)
    public Integer getTransDtlSeq() {
        return transDtlSeq;
    }

    public void setTransDtlSeq(Integer transDtlSeq) {
        this.transDtlSeq = transDtlSeq;
    }

    @Basic
    @Column(name = "FUND_NO",length = 20)
    public String getFundNo() {
        return fundNo;
    }

    public void setFundNo(String fundNo) {
        this.fundNo = fundNo;
    }

    @Basic
    @Column(name = "GOPAY_INT_TXN_CD",length = 6)
    public String getGopayIntTxnCd() {
        return gopayIntTxnCd;
    }

    public void setGopayIntTxnCd(String gopayIntTxnCd) {
        this.gopayIntTxnCd = gopayIntTxnCd;
    }

    @Basic
    @Column(name = "MERCHANT_ID",length = 10)
    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    @Basic
    @Column(name = "MER_ORDER_NUM",length = 30)
    public String getMerOrderNum() {
        return merOrderNum;
    }

    public void setMerOrderNum(String merOrderNum) {
        this.merOrderNum = merOrderNum;
    }

    @Basic
    @Column(name = "TRAN_TYPE",length = 2)
    public String getTranType() {
        return tranType;
    }

    public void setTranType(String tranType) {
        this.tranType = tranType;
    }

    @Basic
    @Column(name = "ORDER_TYPE",length = 2)
    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    @Basic
    @Column(name = "TOTAL_ORDER_AMT",length = 20)
    public BigDecimal getTotalOrderAmt() {
        return totalOrderAmt;
    }

    public void setTotalOrderAmt(BigDecimal totalOrderAmt) {
        this.totalOrderAmt = totalOrderAmt;
    }

    @Basic
    @Column(name = "TOTAL_ORDER_FEE_AMT",length = 20)
    public BigDecimal getTotalOrderFeeAmt() {
        return totalOrderFeeAmt;
    }

    public void setTotalOrderFeeAmt(BigDecimal totalOrderFeeAmt) {
        this.totalOrderFeeAmt = totalOrderFeeAmt;
    }

    @Basic
    @Column(name = "ORDER_DEAL_AMT",length = 20)
    public BigDecimal getOrderDealAmt() {
        return orderDealAmt;
    }

    public void setOrderDealAmt(BigDecimal orderDealAmt) {
        this.orderDealAmt = orderDealAmt;
    }

    @Basic
    @Column(name = "ORDER_REAL_FEE_AMT",length = 20)
    public BigDecimal getOrderRealFeeAmt() {
        return orderRealFeeAmt;
    }

    public void setOrderRealFeeAmt(BigDecimal orderRealFeeAmt) {
        this.orderRealFeeAmt = orderRealFeeAmt;
    }

    @Basic
    @Column(name = "TRAN_FINISH_TIME",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getTranFinishTime() {
        return tranFinishTime;
    }

    public void setTranFinishTime(Date tranFinishTime) {
        this.tranFinishTime = tranFinishTime;
    }

    @Basic
    @Column(name = "ORIG_MER_ORDER_NUM",length = 30)
    public String getOrigMerOrderNum() {
        return origMerOrderNum;
    }

    public void setOrigMerOrderNum(String origMerOrderNum) {
        this.origMerOrderNum = origMerOrderNum;
    }

    @Basic
    @Column(name = "RESP_CODE",length = 6)
    public String getRespCode() {
        return respCode;
    }

    public void setRespCode(String respCode) {
        this.respCode = respCode;
    }

    @Basic
    @Column(name = "VERIFY_CODE",length = 6)
    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    @Basic
    @Column(name = "CARD_NO",length = 150)
    public String getCardNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.cardNo = SensitiveInfoUtils.autoReencrypt(this.cardNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setCardNo(String cardNo) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Basic
    @Column(name = "BANK_CODE",length = 10)
    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    @Basic
    @Column(name = "STLM_DATE",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getStlmDate() {
        return stlmDate;
    }

    public void setStlmDate(Date stlmDate) {
        this.stlmDate = stlmDate;
    }

    @Basic
    @Column(name = "BACKGROUND_MER_URL",length = 256)
    public String getBackgroundMerUrl() {
        return backgroundMerUrl;
    }

    public void setBackgroundMerUrl(String backgroundMerUrl) {
        this.backgroundMerUrl = backgroundMerUrl;
    }

    @Basic
    @Column(name = "MER_REMARK1",length = 500)
    public String getMerRemark1() {
        return merRemark1;
    }

    public void setMerRemark1(String merRemark1) {
        this.merRemark1 = merRemark1;
    }

    @Basic
    @Column(name = "MER_REMARK2",length = 500)
    public String getMerRemark2() {
        return merRemark2;
    }

    public void setMerRemark2(String merRemark2) {
        this.merRemark2 = merRemark2;
    }

    @Basic
    @Column(name = "TRAN_IP",length = 19)
    public String getTranIp() {
        return tranIp;
    }

    public void setTranIp(String tranIp) {
        this.tranIp = tranIp;
    }

    @Basic
    @Column(name = "DATA_SOURCE",length = 1)
    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    @Basic
    @Column(name = "SOURCE",length = 1)
    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Basic
    @Column(name = "MEMO",length = 256)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "CREATED_TS",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Basic
    @Column(name = "LAST_UPD_TS",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Basic
    @Column(name = "RELEVANCE_GOPAY_ORDER_ID",length = 30)
    public String getRelevanceGopayOrderId() {
        return relevanceGopayOrderId;
    }

    public void setRelevanceGopayOrderId(String relevanceGopayOrderId) {
        this.relevanceGopayOrderId = relevanceGopayOrderId;
    }

    @Basic
    @Column(name = "TOTAL_NUM",length = 20)
    public Integer getCountNum() {
        return countNum;
    }

    public void setCountNum(Integer countNum) {
        this.countNum = countNum;
    }

    @Basic
    @Column(name = "BIZ_TYPE",length = 2)
    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }
    @Column(name = "MER_TXN_AMT", precision = 20)
    public BigDecimal getMerTxnAmt() {
        return merTxnAmt;
    }

    public void setMerTxnAmt(BigDecimal merTxnAmt) {
        this.merTxnAmt = merTxnAmt;
    }

    @Column(name = "HISTORY_ORDER_ID",length = 768)
    public String getHistoryOrderId() {
        return historyOrderId;
    }

    public void setHistoryOrderId(String historyOrderId) {
        this.historyOrderId = historyOrderId;
    }

    @Column(name = "LAST_ERROR_MSG",length = 128)
    public String getLastErrorMsg() {
        return lastErrorMsg;
    }

    public void setLastErrorMsg(String lastErrorMsg) {
        this.lastErrorMsg = lastErrorMsg;
    }

    @Basic
    @Column(name = "LAST_REDO_TS",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastRedoTs() {
        return lastRedoTs;
    }

    public void setLastRedoTs(Date lastRedoTs) {
        this.lastRedoTs = lastRedoTs;
    }

    @Column(name = "WITHDRAW_TYPE",length = 1)
    public String getWithdrawType() {
        return withdrawType;
    }

    public void setWithdrawType(String withdrawType) {
        this.withdrawType = withdrawType;
    }

    @Column(name = "WITHDRAW_ACCT_TYPE",length = 1)
    public String getWithdrawAcctType() {
        return withdrawAcctType;
    }

    public void setWithdrawAcctType(String withdrawAcctType) {
        this.withdrawAcctType = withdrawAcctType;
    }

    @Column(name = "WITHDRAW_ACCT_ID",length = 32)
    public String getWithdrawAcctId() {
        return withdrawAcctId;
    }

    public void setWithdrawAcctId(String withdrawAcctId) {
        this.withdrawAcctId = withdrawAcctId;
    }
}
